3.206 \(\int \frac {\sec (e+f x) (a+a \sec (e+f x))^3}{(c+d \sec (e+f x))^2} \, dx\)

Optimal. Leaf size=161 \[ -\frac {a^3 (2 c-3 d) \tanh ^{-1}(\sin (e+f x))}{d^3 f}+\frac {2 a^3 (c-d)^{3/2} (2 c+3 d) \tanh ^{-1}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{d^3 f (c+d)^{3/2}}+\frac {2 a^3 c \tan (e+f x)}{d^2 f (c+d)}-\frac {(c-d) \tan (e+f x) \left (a^3 \sec (e+f x)+a^3\right )}{d f (c+d) (c+d \sec (e+f x))} \]

[Out]

-a^3*(2*c-3*d)*arctanh(sin(f*x+e))/d^3/f+2*a^3*(c-d)^(3/2)*(2*c+3*d)*arctanh((c-d)^(1/2)*tan(1/2*e+1/2*f*x)/(c
+d)^(1/2))/d^3/(c+d)^(3/2)/f+2*a^3*c*tan(f*x+e)/d^2/(c+d)/f-(c-d)*(a^3+a^3*sec(f*x+e))*tan(f*x+e)/d/(c+d)/f/(c
+d*sec(f*x+e))

________________________________________________________________________________________

Rubi [A]  time = 0.35, antiderivative size = 274, normalized size of antiderivative = 1.70, number of steps used = 9, number of rules used = 9, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.290, Rules used = {3987, 98, 154, 157, 63, 217, 203, 93, 205} \[ \frac {2 a^3 c \tan (e+f x)}{d^2 f (c+d)}-\frac {2 a^4 (2 c-3 d) \tan (e+f x) \tan ^{-1}\left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a (\sec (e+f x)+1)}}\right )}{d^3 f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}-\frac {2 a^4 (c-d)^{3/2} (2 c+3 d) \tan (e+f x) \tan ^{-1}\left (\frac {\sqrt {c+d} \sqrt {a \sec (e+f x)+a}}{\sqrt {c-d} \sqrt {a-a \sec (e+f x)}}\right )}{d^3 f (c+d)^{3/2} \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}-\frac {(c-d) \tan (e+f x) \left (a^3 \sec (e+f x)+a^3\right )}{d f (c+d) (c+d \sec (e+f x))} \]

Antiderivative was successfully verified.

[In]

Int[(Sec[e + f*x]*(a + a*Sec[e + f*x])^3)/(c + d*Sec[e + f*x])^2,x]

[Out]

(2*a^3*c*Tan[e + f*x])/(d^2*(c + d)*f) - (2*a^4*(2*c - 3*d)*ArcTan[Sqrt[a - a*Sec[e + f*x]]/Sqrt[a*(1 + Sec[e
+ f*x])]]*Tan[e + f*x])/(d^3*f*Sqrt[a - a*Sec[e + f*x]]*Sqrt[a + a*Sec[e + f*x]]) - (2*a^4*(c - d)^(3/2)*(2*c
+ 3*d)*ArcTan[(Sqrt[c + d]*Sqrt[a + a*Sec[e + f*x]])/(Sqrt[c - d]*Sqrt[a - a*Sec[e + f*x]])]*Tan[e + f*x])/(d^
3*(c + d)^(3/2)*f*Sqrt[a - a*Sec[e + f*x]]*Sqrt[a + a*Sec[e + f*x]]) - ((c - d)*(a^3 + a^3*Sec[e + f*x])*Tan[e
 + f*x])/(d*(c + d)*f*(c + d*Sec[e + f*x]))

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 93

Int[(((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_))/((e_.) + (f_.)*(x_)), x_Symbol] :> With[{q = Denomin
ator[m]}, Dist[q, Subst[Int[x^(q*(m + 1) - 1)/(b*e - a*f - (d*e - c*f)*x^q), x], x, (a + b*x)^(1/q)/(c + d*x)^
(1/q)], x]] /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[m + n + 1, 0] && RationalQ[n] && LtQ[-1, m, 0] && SimplerQ[
a + b*x, c + d*x]

Rule 98

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[((b*c -
 a*d)*(a + b*x)^(m + 1)*(c + d*x)^(n - 1)*(e + f*x)^(p + 1))/(b*(b*e - a*f)*(m + 1)), x] + Dist[1/(b*(b*e - a*
f)*(m + 1)), Int[(a + b*x)^(m + 1)*(c + d*x)^(n - 2)*(e + f*x)^p*Simp[a*d*(d*e*(n - 1) + c*f*(p + 1)) + b*c*(d
*e*(m - n + 2) - c*f*(m + p + 2)) + d*(a*d*f*(n + p) + b*(d*e*(m + 1) - c*f*(m + n + p + 1)))*x, x], x], x] /;
 FreeQ[{a, b, c, d, e, f, p}, x] && LtQ[m, -1] && GtQ[n, 1] && (IntegersQ[2*m, 2*n, 2*p] || IntegersQ[m, n + p
] || IntegersQ[p, m + n])

Rule 154

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_)), x_Symb
ol] :> Simp[(h*(a + b*x)^m*(c + d*x)^(n + 1)*(e + f*x)^(p + 1))/(d*f*(m + n + p + 2)), x] + Dist[1/(d*f*(m + n
 + p + 2)), Int[(a + b*x)^(m - 1)*(c + d*x)^n*(e + f*x)^p*Simp[a*d*f*g*(m + n + p + 2) - h*(b*c*e*m + a*(d*e*(
n + 1) + c*f*(p + 1))) + (b*d*f*g*(m + n + p + 2) + h*(a*d*f*m - b*(d*e*(m + n + 1) + c*f*(m + p + 1))))*x, x]
, x], x] /; FreeQ[{a, b, c, d, e, f, g, h, n, p}, x] && GtQ[m, 0] && NeQ[m + n + p + 2, 0] && IntegersQ[2*m, 2
*n, 2*p]

Rule 157

Int[(((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_)))/((a_.) + (b_.)*(x_)), x_Symbol]
 :> Dist[h/b, Int[(c + d*x)^n*(e + f*x)^p, x], x] + Dist[(b*g - a*h)/b, Int[((c + d*x)^n*(e + f*x)^p)/(a + b*x
), x], x] /; FreeQ[{a, b, c, d, e, f, g, h, n, p}, x]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 3987

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]
*(d_.) + (c_))^(n_), x_Symbol] :> Dist[(a^2*g*Cot[e + f*x])/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[a - b*Csc[e + f*x
]]), Subst[Int[((g*x)^(p - 1)*(a + b*x)^(m - 1/2)*(c + d*x)^n)/Sqrt[a - b*x], x], x, Csc[e + f*x]], x] /; Free
Q[{a, b, c, d, e, f, g, m, n, p}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && (EqQ[p,
 1] || IntegerQ[m - 1/2])

Rubi steps

\begin {align*} \int \frac {\sec (e+f x) (a+a \sec (e+f x))^3}{(c+d \sec (e+f x))^2} \, dx &=-\frac {\left (a^2 \tan (e+f x)\right ) \operatorname {Subst}\left (\int \frac {(a+a x)^{5/2}}{\sqrt {a-a x} (c+d x)^2} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=-\frac {(c-d) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{d (c+d) f (c+d \sec (e+f x))}+\frac {(a \tan (e+f x)) \operatorname {Subst}\left (\int \frac {\sqrt {a+a x} \left (a^3 (c-3 d)-2 a^3 c x\right )}{\sqrt {a-a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{d (c+d) f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {2 a^3 c \tan (e+f x)}{d^2 (c+d) f}-\frac {(c-d) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{d (c+d) f (c+d \sec (e+f x))}-\frac {\tan (e+f x) \operatorname {Subst}\left (\int \frac {-a^5 (c-3 d) d-a^5 (2 c-3 d) (c+d) x}{\sqrt {a-a x} \sqrt {a+a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{d^2 (c+d) f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {2 a^3 c \tan (e+f x)}{d^2 (c+d) f}-\frac {(c-d) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{d (c+d) f (c+d \sec (e+f x))}+\frac {\left (a^5 (2 c-3 d) \tan (e+f x)\right ) \operatorname {Subst}\left (\int \frac {1}{\sqrt {a-a x} \sqrt {a+a x}} \, dx,x,\sec (e+f x)\right )}{d^3 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}-\frac {\left (a^5 (c-d)^2 (2 c+3 d) \tan (e+f x)\right ) \operatorname {Subst}\left (\int \frac {1}{\sqrt {a-a x} \sqrt {a+a x} (c+d x)} \, dx,x,\sec (e+f x)\right )}{d^3 (c+d) f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {2 a^3 c \tan (e+f x)}{d^2 (c+d) f}-\frac {(c-d) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{d (c+d) f (c+d \sec (e+f x))}-\frac {\left (2 a^4 (2 c-3 d) \tan (e+f x)\right ) \operatorname {Subst}\left (\int \frac {1}{\sqrt {2 a-x^2}} \, dx,x,\sqrt {a-a \sec (e+f x)}\right )}{d^3 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}-\frac {\left (2 a^5 (c-d)^2 (2 c+3 d) \tan (e+f x)\right ) \operatorname {Subst}\left (\int \frac {1}{a c-a d-(-a c-a d) x^2} \, dx,x,\frac {\sqrt {a+a \sec (e+f x)}}{\sqrt {a-a \sec (e+f x)}}\right )}{d^3 (c+d) f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {2 a^3 c \tan (e+f x)}{d^2 (c+d) f}-\frac {2 a^4 (c-d)^{3/2} (2 c+3 d) \tan ^{-1}\left (\frac {\sqrt {c+d} \sqrt {a+a \sec (e+f x)}}{\sqrt {c-d} \sqrt {a-a \sec (e+f x)}}\right ) \tan (e+f x)}{d^3 (c+d)^{3/2} f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}-\frac {(c-d) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{d (c+d) f (c+d \sec (e+f x))}-\frac {\left (2 a^4 (2 c-3 d) \tan (e+f x)\right ) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a+a \sec (e+f x)}}\right )}{d^3 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}\\ &=\frac {2 a^3 c \tan (e+f x)}{d^2 (c+d) f}-\frac {2 a^4 (2 c-3 d) \tan ^{-1}\left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a+a \sec (e+f x)}}\right ) \tan (e+f x)}{d^3 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}-\frac {2 a^4 (c-d)^{3/2} (2 c+3 d) \tan ^{-1}\left (\frac {\sqrt {c+d} \sqrt {a+a \sec (e+f x)}}{\sqrt {c-d} \sqrt {a-a \sec (e+f x)}}\right ) \tan (e+f x)}{d^3 (c+d)^{3/2} f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}}-\frac {(c-d) \left (a^3+a^3 \sec (e+f x)\right ) \tan (e+f x)}{d (c+d) f (c+d \sec (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 4.21, size = 455, normalized size = 2.83 \[ \frac {a^3 \cos (e+f x) \sec ^6\left (\frac {1}{2} (e+f x)\right ) (\sec (e+f x)+1)^3 (c \cos (e+f x)+d) \left (-\frac {2 i (2 c+3 d) (c-d)^2 (\cos (e)-i \sin (e)) (c \cos (e+f x)+d) \tan ^{-1}\left (\frac {(\sin (e)+i \cos (e)) \left (\tan \left (\frac {f x}{2}\right ) (c \cos (e)-d)+c \sin (e)\right )}{\sqrt {c^2-d^2} \sqrt {(\cos (e)-i \sin (e))^2}}\right )}{(c+d) \sqrt {c^2-d^2} \sqrt {(\cos (e)-i \sin (e))^2}}+\frac {d (c-d)^2 (c \sin (f x)-d \sin (e))}{c (c+d) \left (\cos \left (\frac {e}{2}\right )-\sin \left (\frac {e}{2}\right )\right ) \left (\sin \left (\frac {e}{2}\right )+\cos \left (\frac {e}{2}\right )\right )}+\frac {d \sin \left (\frac {f x}{2}\right ) (c \cos (e+f x)+d)}{\left (\cos \left (\frac {e}{2}\right )-\sin \left (\frac {e}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )}+\frac {d \sin \left (\frac {f x}{2}\right ) (c \cos (e+f x)+d)}{\left (\sin \left (\frac {e}{2}\right )+\cos \left (\frac {e}{2}\right )\right ) \left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right )}+(2 c-3 d) (c \cos (e+f x)+d) \log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )+(3 d-2 c) (c \cos (e+f x)+d) \log \left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right )\right )}{8 d^3 f (c+d \sec (e+f x))^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(Sec[e + f*x]*(a + a*Sec[e + f*x])^3)/(c + d*Sec[e + f*x])^2,x]

[Out]

(a^3*Cos[e + f*x]*(d + c*Cos[e + f*x])*Sec[(e + f*x)/2]^6*(1 + Sec[e + f*x])^3*((2*c - 3*d)*(d + c*Cos[e + f*x
])*Log[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] + (-2*c + 3*d)*(d + c*Cos[e + f*x])*Log[Cos[(e + f*x)/2] + Sin[(e
+ f*x)/2]] - ((2*I)*(c - d)^2*(2*c + 3*d)*ArcTan[((I*Cos[e] + Sin[e])*(c*Sin[e] + (-d + c*Cos[e])*Tan[(f*x)/2]
))/(Sqrt[c^2 - d^2]*Sqrt[(Cos[e] - I*Sin[e])^2])]*(d + c*Cos[e + f*x])*(Cos[e] - I*Sin[e]))/((c + d)*Sqrt[c^2
- d^2]*Sqrt[(Cos[e] - I*Sin[e])^2]) + ((c - d)^2*d*(-(d*Sin[e]) + c*Sin[f*x]))/(c*(c + d)*(Cos[e/2] - Sin[e/2]
)*(Cos[e/2] + Sin[e/2])) + (d*(d + c*Cos[e + f*x])*Sin[(f*x)/2])/((Cos[e/2] - Sin[e/2])*(Cos[(e + f*x)/2] - Si
n[(e + f*x)/2])) + (d*(d + c*Cos[e + f*x])*Sin[(f*x)/2])/((Cos[e/2] + Sin[e/2])*(Cos[(e + f*x)/2] + Sin[(e + f
*x)/2]))))/(8*d^3*f*(c + d*Sec[e + f*x])^2)

________________________________________________________________________________________

fricas [B]  time = 0.92, size = 859, normalized size = 5.34 \[ \left [-\frac {{\left ({\left (2 \, a^{3} c^{3} + a^{3} c^{2} d - 3 \, a^{3} c d^{2}\right )} \cos \left (f x + e\right )^{2} + {\left (2 \, a^{3} c^{2} d + a^{3} c d^{2} - 3 \, a^{3} d^{3}\right )} \cos \left (f x + e\right )\right )} \sqrt {\frac {c - d}{c + d}} \log \left (\frac {2 \, c d \cos \left (f x + e\right ) - {\left (c^{2} - 2 \, d^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, {\left (c^{2} + c d + {\left (c d + d^{2}\right )} \cos \left (f x + e\right )\right )} \sqrt {\frac {c - d}{c + d}} \sin \left (f x + e\right ) + 2 \, c^{2} - d^{2}}{c^{2} \cos \left (f x + e\right )^{2} + 2 \, c d \cos \left (f x + e\right ) + d^{2}}\right ) + {\left ({\left (2 \, a^{3} c^{3} - a^{3} c^{2} d - 3 \, a^{3} c d^{2}\right )} \cos \left (f x + e\right )^{2} + {\left (2 \, a^{3} c^{2} d - a^{3} c d^{2} - 3 \, a^{3} d^{3}\right )} \cos \left (f x + e\right )\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left ({\left (2 \, a^{3} c^{3} - a^{3} c^{2} d - 3 \, a^{3} c d^{2}\right )} \cos \left (f x + e\right )^{2} + {\left (2 \, a^{3} c^{2} d - a^{3} c d^{2} - 3 \, a^{3} d^{3}\right )} \cos \left (f x + e\right )\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) - 2 \, {\left (a^{3} c d^{2} + a^{3} d^{3} + {\left (2 \, a^{3} c^{2} d - a^{3} c d^{2} + a^{3} d^{3}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{2 \, {\left ({\left (c^{2} d^{3} + c d^{4}\right )} f \cos \left (f x + e\right )^{2} + {\left (c d^{4} + d^{5}\right )} f \cos \left (f x + e\right )\right )}}, \frac {2 \, {\left ({\left (2 \, a^{3} c^{3} + a^{3} c^{2} d - 3 \, a^{3} c d^{2}\right )} \cos \left (f x + e\right )^{2} + {\left (2 \, a^{3} c^{2} d + a^{3} c d^{2} - 3 \, a^{3} d^{3}\right )} \cos \left (f x + e\right )\right )} \sqrt {-\frac {c - d}{c + d}} \arctan \left (-\frac {{\left (d \cos \left (f x + e\right ) + c\right )} \sqrt {-\frac {c - d}{c + d}}}{{\left (c - d\right )} \sin \left (f x + e\right )}\right ) - {\left ({\left (2 \, a^{3} c^{3} - a^{3} c^{2} d - 3 \, a^{3} c d^{2}\right )} \cos \left (f x + e\right )^{2} + {\left (2 \, a^{3} c^{2} d - a^{3} c d^{2} - 3 \, a^{3} d^{3}\right )} \cos \left (f x + e\right )\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) + {\left ({\left (2 \, a^{3} c^{3} - a^{3} c^{2} d - 3 \, a^{3} c d^{2}\right )} \cos \left (f x + e\right )^{2} + {\left (2 \, a^{3} c^{2} d - a^{3} c d^{2} - 3 \, a^{3} d^{3}\right )} \cos \left (f x + e\right )\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (a^{3} c d^{2} + a^{3} d^{3} + {\left (2 \, a^{3} c^{2} d - a^{3} c d^{2} + a^{3} d^{3}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{2 \, {\left ({\left (c^{2} d^{3} + c d^{4}\right )} f \cos \left (f x + e\right )^{2} + {\left (c d^{4} + d^{5}\right )} f \cos \left (f x + e\right )\right )}}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3/(c+d*sec(f*x+e))^2,x, algorithm="fricas")

[Out]

[-1/2*(((2*a^3*c^3 + a^3*c^2*d - 3*a^3*c*d^2)*cos(f*x + e)^2 + (2*a^3*c^2*d + a^3*c*d^2 - 3*a^3*d^3)*cos(f*x +
 e))*sqrt((c - d)/(c + d))*log((2*c*d*cos(f*x + e) - (c^2 - 2*d^2)*cos(f*x + e)^2 - 2*(c^2 + c*d + (c*d + d^2)
*cos(f*x + e))*sqrt((c - d)/(c + d))*sin(f*x + e) + 2*c^2 - d^2)/(c^2*cos(f*x + e)^2 + 2*c*d*cos(f*x + e) + d^
2)) + ((2*a^3*c^3 - a^3*c^2*d - 3*a^3*c*d^2)*cos(f*x + e)^2 + (2*a^3*c^2*d - a^3*c*d^2 - 3*a^3*d^3)*cos(f*x +
e))*log(sin(f*x + e) + 1) - ((2*a^3*c^3 - a^3*c^2*d - 3*a^3*c*d^2)*cos(f*x + e)^2 + (2*a^3*c^2*d - a^3*c*d^2 -
 3*a^3*d^3)*cos(f*x + e))*log(-sin(f*x + e) + 1) - 2*(a^3*c*d^2 + a^3*d^3 + (2*a^3*c^2*d - a^3*c*d^2 + a^3*d^3
)*cos(f*x + e))*sin(f*x + e))/((c^2*d^3 + c*d^4)*f*cos(f*x + e)^2 + (c*d^4 + d^5)*f*cos(f*x + e)), 1/2*(2*((2*
a^3*c^3 + a^3*c^2*d - 3*a^3*c*d^2)*cos(f*x + e)^2 + (2*a^3*c^2*d + a^3*c*d^2 - 3*a^3*d^3)*cos(f*x + e))*sqrt(-
(c - d)/(c + d))*arctan(-(d*cos(f*x + e) + c)*sqrt(-(c - d)/(c + d))/((c - d)*sin(f*x + e))) - ((2*a^3*c^3 - a
^3*c^2*d - 3*a^3*c*d^2)*cos(f*x + e)^2 + (2*a^3*c^2*d - a^3*c*d^2 - 3*a^3*d^3)*cos(f*x + e))*log(sin(f*x + e)
+ 1) + ((2*a^3*c^3 - a^3*c^2*d - 3*a^3*c*d^2)*cos(f*x + e)^2 + (2*a^3*c^2*d - a^3*c*d^2 - 3*a^3*d^3)*cos(f*x +
 e))*log(-sin(f*x + e) + 1) + 2*(a^3*c*d^2 + a^3*d^3 + (2*a^3*c^2*d - a^3*c*d^2 + a^3*d^3)*cos(f*x + e))*sin(f
*x + e))/((c^2*d^3 + c*d^4)*f*cos(f*x + e)^2 + (c*d^4 + d^5)*f*cos(f*x + e))]

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3/(c+d*sec(f*x+e))^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (4*pi/x/2)>(-4*pi/
x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)2/f*(-(-2*a^3*c+3*a^3*d)*1/2/d^3*ln(abs(tan((f*x+exp(1))/2)-1)
)+(-2*a^3*c+3*a^3*d)*1/2/d^3*ln(abs(tan((f*x+exp(1))/2)+1))+(-4*a^3*c^3+2*a^3*c^2*d+8*a^3*c*d^2-6*a^3*d^3)*1/2
/(c*d^3+d^4)/sqrt(-c^2+d^2)*(atan((c*tan((f*x+exp(1))/2)-d*tan((f*x+exp(1))/2))/sqrt(-c^2+d^2))+pi*sign(2*c-2*
d)*floor((f*x+exp(1))/2/pi+1/2))+(-2*tan((f*x+exp(1))/2)^3*a^3*c^2+2*tan((f*x+exp(1))/2)^3*a^3*c*d+2*tan((f*x+
exp(1))/2)*a^3*c^2+2*tan((f*x+exp(1))/2)*a^3*d^2)/(c*d^2+d^3)/(tan((f*x+exp(1))/2)^4*c-tan((f*x+exp(1))/2)^4*d
-2*tan((f*x+exp(1))/2)^2*c+c+d))

________________________________________________________________________________________

maple [B]  time = 0.70, size = 548, normalized size = 3.40 \[ -\frac {2 a^{3} \tan \left (\frac {e}{2}+\frac {f x}{2}\right ) c^{2}}{f \,d^{2} \left (c +d \right ) \left (\left (\tan ^{2}\left (\frac {e}{2}+\frac {f x}{2}\right )\right ) c -\left (\tan ^{2}\left (\frac {e}{2}+\frac {f x}{2}\right )\right ) d -c -d \right )}+\frac {4 a^{3} \tan \left (\frac {e}{2}+\frac {f x}{2}\right ) c}{f d \left (c +d \right ) \left (\left (\tan ^{2}\left (\frac {e}{2}+\frac {f x}{2}\right )\right ) c -\left (\tan ^{2}\left (\frac {e}{2}+\frac {f x}{2}\right )\right ) d -c -d \right )}-\frac {2 a^{3} \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{f \left (c +d \right ) \left (\left (\tan ^{2}\left (\frac {e}{2}+\frac {f x}{2}\right )\right ) c -\left (\tan ^{2}\left (\frac {e}{2}+\frac {f x}{2}\right )\right ) d -c -d \right )}+\frac {4 a^{3} \arctanh \left (\frac {\tan \left (\frac {e}{2}+\frac {f x}{2}\right ) \left (c -d \right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right ) c^{3}}{f \,d^{3} \left (c +d \right ) \sqrt {\left (c +d \right ) \left (c -d \right )}}-\frac {2 a^{3} \arctanh \left (\frac {\tan \left (\frac {e}{2}+\frac {f x}{2}\right ) \left (c -d \right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right ) c^{2}}{f \,d^{2} \left (c +d \right ) \sqrt {\left (c +d \right ) \left (c -d \right )}}-\frac {8 a^{3} \arctanh \left (\frac {\tan \left (\frac {e}{2}+\frac {f x}{2}\right ) \left (c -d \right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right ) c}{f d \left (c +d \right ) \sqrt {\left (c +d \right ) \left (c -d \right )}}+\frac {6 a^{3} \arctanh \left (\frac {\tan \left (\frac {e}{2}+\frac {f x}{2}\right ) \left (c -d \right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{f \left (c +d \right ) \sqrt {\left (c +d \right ) \left (c -d \right )}}-\frac {a^{3}}{f \,d^{2} \left (\tan \left (\frac {e}{2}+\frac {f x}{2}\right )-1\right )}+\frac {2 a^{3} \ln \left (\tan \left (\frac {e}{2}+\frac {f x}{2}\right )-1\right ) c}{f \,d^{3}}-\frac {3 a^{3} \ln \left (\tan \left (\frac {e}{2}+\frac {f x}{2}\right )-1\right )}{f \,d^{2}}-\frac {a^{3}}{f \,d^{2} \left (\tan \left (\frac {e}{2}+\frac {f x}{2}\right )+1\right )}-\frac {2 a^{3} \ln \left (\tan \left (\frac {e}{2}+\frac {f x}{2}\right )+1\right ) c}{f \,d^{3}}+\frac {3 a^{3} \ln \left (\tan \left (\frac {e}{2}+\frac {f x}{2}\right )+1\right )}{f \,d^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(f*x+e)*(a+a*sec(f*x+e))^3/(c+d*sec(f*x+e))^2,x)

[Out]

-2/f*a^3/d^2/(c+d)*tan(1/2*e+1/2*f*x)/(tan(1/2*e+1/2*f*x)^2*c-tan(1/2*e+1/2*f*x)^2*d-c-d)*c^2+4/f*a^3/d/(c+d)*
tan(1/2*e+1/2*f*x)/(tan(1/2*e+1/2*f*x)^2*c-tan(1/2*e+1/2*f*x)^2*d-c-d)*c-2/f*a^3/(c+d)*tan(1/2*e+1/2*f*x)/(tan
(1/2*e+1/2*f*x)^2*c-tan(1/2*e+1/2*f*x)^2*d-c-d)+4/f*a^3/d^3/(c+d)/((c+d)*(c-d))^(1/2)*arctanh(tan(1/2*e+1/2*f*
x)*(c-d)/((c+d)*(c-d))^(1/2))*c^3-2/f*a^3/d^2/(c+d)/((c+d)*(c-d))^(1/2)*arctanh(tan(1/2*e+1/2*f*x)*(c-d)/((c+d
)*(c-d))^(1/2))*c^2-8/f*a^3/d/(c+d)/((c+d)*(c-d))^(1/2)*arctanh(tan(1/2*e+1/2*f*x)*(c-d)/((c+d)*(c-d))^(1/2))*
c+6/f*a^3/(c+d)/((c+d)*(c-d))^(1/2)*arctanh(tan(1/2*e+1/2*f*x)*(c-d)/((c+d)*(c-d))^(1/2))-1/f*a^3/d^2/(tan(1/2
*e+1/2*f*x)-1)+2/f*a^3/d^3*ln(tan(1/2*e+1/2*f*x)-1)*c-3/f*a^3/d^2*ln(tan(1/2*e+1/2*f*x)-1)-1/f*a^3/d^2/(tan(1/
2*e+1/2*f*x)+1)-2/f*a^3/d^3*ln(tan(1/2*e+1/2*f*x)+1)*c+3/f*a^3/d^2*ln(tan(1/2*e+1/2*f*x)+1)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^3/(c+d*sec(f*x+e))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*c^2-4*d^2>0)', see `assume?`
 for more details)Is 4*c^2-4*d^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 5.27, size = 3135, normalized size = 19.47 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a/cos(e + f*x))^3/(cos(e + f*x)*(c + d/cos(e + f*x))^2),x)

[Out]

(a^3*atan(((a^3*((64*tan(e/2 + (f*x)/2)*(4*a^6*c^7 - 9*a^6*d^7 + 27*a^6*c*d^6 - 12*a^6*c^6*d - 16*a^6*c^2*d^5
- 24*a^6*c^3*d^4 + 29*a^6*c^4*d^3 + a^6*c^5*d^2))/(2*c*d^5 + d^6 + c^2*d^4) + (a^3*((64*(3*a^3*d^11 - 3*a^3*c*
d^10 - 4*a^3*c^2*d^9 + 4*a^3*c^3*d^8 + a^3*c^4*d^7 - a^3*c^5*d^6))/(2*c*d^7 + d^8 + c^2*d^6) - (64*a^3*tan(e/2
 + (f*x)/2)*(2*c - 3*d)*(c*d^10 - 2*c^3*d^8 + c^5*d^6))/(d^3*(2*c*d^5 + d^6 + c^2*d^4)))*(2*c - 3*d))/d^3)*(2*
c - 3*d)*1i)/d^3 + (a^3*((64*tan(e/2 + (f*x)/2)*(4*a^6*c^7 - 9*a^6*d^7 + 27*a^6*c*d^6 - 12*a^6*c^6*d - 16*a^6*
c^2*d^5 - 24*a^6*c^3*d^4 + 29*a^6*c^4*d^3 + a^6*c^5*d^2))/(2*c*d^5 + d^6 + c^2*d^4) - (a^3*((64*(3*a^3*d^11 -
3*a^3*c*d^10 - 4*a^3*c^2*d^9 + 4*a^3*c^3*d^8 + a^3*c^4*d^7 - a^3*c^5*d^6))/(2*c*d^7 + d^8 + c^2*d^6) + (64*a^3
*tan(e/2 + (f*x)/2)*(2*c - 3*d)*(c*d^10 - 2*c^3*d^8 + c^5*d^6))/(d^3*(2*c*d^5 + d^6 + c^2*d^4)))*(2*c - 3*d))/
d^3)*(2*c - 3*d)*1i)/d^3)/((128*(4*a^9*c^7 - 9*a^9*c*d^6 - 16*a^9*c^6*d + 36*a^9*c^2*d^5 - 50*a^9*c^3*d^4 + 20
*a^9*c^4*d^3 + 15*a^9*c^5*d^2))/(2*c*d^7 + d^8 + c^2*d^6) + (a^3*((64*tan(e/2 + (f*x)/2)*(4*a^6*c^7 - 9*a^6*d^
7 + 27*a^6*c*d^6 - 12*a^6*c^6*d - 16*a^6*c^2*d^5 - 24*a^6*c^3*d^4 + 29*a^6*c^4*d^3 + a^6*c^5*d^2))/(2*c*d^5 +
d^6 + c^2*d^4) + (a^3*((64*(3*a^3*d^11 - 3*a^3*c*d^10 - 4*a^3*c^2*d^9 + 4*a^3*c^3*d^8 + a^3*c^4*d^7 - a^3*c^5*
d^6))/(2*c*d^7 + d^8 + c^2*d^6) - (64*a^3*tan(e/2 + (f*x)/2)*(2*c - 3*d)*(c*d^10 - 2*c^3*d^8 + c^5*d^6))/(d^3*
(2*c*d^5 + d^6 + c^2*d^4)))*(2*c - 3*d))/d^3)*(2*c - 3*d))/d^3 - (a^3*((64*tan(e/2 + (f*x)/2)*(4*a^6*c^7 - 9*a
^6*d^7 + 27*a^6*c*d^6 - 12*a^6*c^6*d - 16*a^6*c^2*d^5 - 24*a^6*c^3*d^4 + 29*a^6*c^4*d^3 + a^6*c^5*d^2))/(2*c*d
^5 + d^6 + c^2*d^4) - (a^3*((64*(3*a^3*d^11 - 3*a^3*c*d^10 - 4*a^3*c^2*d^9 + 4*a^3*c^3*d^8 + a^3*c^4*d^7 - a^3
*c^5*d^6))/(2*c*d^7 + d^8 + c^2*d^6) + (64*a^3*tan(e/2 + (f*x)/2)*(2*c - 3*d)*(c*d^10 - 2*c^3*d^8 + c^5*d^6))/
(d^3*(2*c*d^5 + d^6 + c^2*d^4)))*(2*c - 3*d))/d^3)*(2*c - 3*d))/d^3))*(2*c - 3*d)*2i)/(d^3*f) - ((4*tan(e/2 +
(f*x)/2)^3*(a^3*c^2 - a^3*c*d))/(d^2*(c + d)) - (4*a^3*tan(e/2 + (f*x)/2)*(c^2 + d^2))/(d^2*(c + d)))/(f*(c +
d + tan(e/2 + (f*x)/2)^4*(c - d) - 2*c*tan(e/2 + (f*x)/2)^2)) + (a^3*atan(((a^3*((64*tan(e/2 + (f*x)/2)*(4*a^6
*c^7 - 9*a^6*d^7 + 27*a^6*c*d^6 - 12*a^6*c^6*d - 16*a^6*c^2*d^5 - 24*a^6*c^3*d^4 + 29*a^6*c^4*d^3 + a^6*c^5*d^
2))/(2*c*d^5 + d^6 + c^2*d^4) + (a^3*((64*(3*a^3*d^11 - 3*a^3*c*d^10 - 4*a^3*c^2*d^9 + 4*a^3*c^3*d^8 + a^3*c^4
*d^7 - a^3*c^5*d^6))/(2*c*d^7 + d^8 + c^2*d^6) - (64*a^3*tan(e/2 + (f*x)/2)*((c + d)^3*(c - d)^3)^(1/2)*(2*c +
 3*d)*(c*d^10 - 2*c^3*d^8 + c^5*d^6))/((2*c*d^5 + d^6 + c^2*d^4)*(3*c*d^5 + d^6 + 3*c^2*d^4 + c^3*d^3)))*((c +
 d)^3*(c - d)^3)^(1/2)*(2*c + 3*d))/(3*c*d^5 + d^6 + 3*c^2*d^4 + c^3*d^3))*((c + d)^3*(c - d)^3)^(1/2)*(2*c +
3*d)*1i)/(3*c*d^5 + d^6 + 3*c^2*d^4 + c^3*d^3) + (a^3*((64*tan(e/2 + (f*x)/2)*(4*a^6*c^7 - 9*a^6*d^7 + 27*a^6*
c*d^6 - 12*a^6*c^6*d - 16*a^6*c^2*d^5 - 24*a^6*c^3*d^4 + 29*a^6*c^4*d^3 + a^6*c^5*d^2))/(2*c*d^5 + d^6 + c^2*d
^4) - (a^3*((64*(3*a^3*d^11 - 3*a^3*c*d^10 - 4*a^3*c^2*d^9 + 4*a^3*c^3*d^8 + a^3*c^4*d^7 - a^3*c^5*d^6))/(2*c*
d^7 + d^8 + c^2*d^6) + (64*a^3*tan(e/2 + (f*x)/2)*((c + d)^3*(c - d)^3)^(1/2)*(2*c + 3*d)*(c*d^10 - 2*c^3*d^8
+ c^5*d^6))/((2*c*d^5 + d^6 + c^2*d^4)*(3*c*d^5 + d^6 + 3*c^2*d^4 + c^3*d^3)))*((c + d)^3*(c - d)^3)^(1/2)*(2*
c + 3*d))/(3*c*d^5 + d^6 + 3*c^2*d^4 + c^3*d^3))*((c + d)^3*(c - d)^3)^(1/2)*(2*c + 3*d)*1i)/(3*c*d^5 + d^6 +
3*c^2*d^4 + c^3*d^3))/((128*(4*a^9*c^7 - 9*a^9*c*d^6 - 16*a^9*c^6*d + 36*a^9*c^2*d^5 - 50*a^9*c^3*d^4 + 20*a^9
*c^4*d^3 + 15*a^9*c^5*d^2))/(2*c*d^7 + d^8 + c^2*d^6) + (a^3*((64*tan(e/2 + (f*x)/2)*(4*a^6*c^7 - 9*a^6*d^7 +
27*a^6*c*d^6 - 12*a^6*c^6*d - 16*a^6*c^2*d^5 - 24*a^6*c^3*d^4 + 29*a^6*c^4*d^3 + a^6*c^5*d^2))/(2*c*d^5 + d^6
+ c^2*d^4) + (a^3*((64*(3*a^3*d^11 - 3*a^3*c*d^10 - 4*a^3*c^2*d^9 + 4*a^3*c^3*d^8 + a^3*c^4*d^7 - a^3*c^5*d^6)
)/(2*c*d^7 + d^8 + c^2*d^6) - (64*a^3*tan(e/2 + (f*x)/2)*((c + d)^3*(c - d)^3)^(1/2)*(2*c + 3*d)*(c*d^10 - 2*c
^3*d^8 + c^5*d^6))/((2*c*d^5 + d^6 + c^2*d^4)*(3*c*d^5 + d^6 + 3*c^2*d^4 + c^3*d^3)))*((c + d)^3*(c - d)^3)^(1
/2)*(2*c + 3*d))/(3*c*d^5 + d^6 + 3*c^2*d^4 + c^3*d^3))*((c + d)^3*(c - d)^3)^(1/2)*(2*c + 3*d))/(3*c*d^5 + d^
6 + 3*c^2*d^4 + c^3*d^3) - (a^3*((64*tan(e/2 + (f*x)/2)*(4*a^6*c^7 - 9*a^6*d^7 + 27*a^6*c*d^6 - 12*a^6*c^6*d -
 16*a^6*c^2*d^5 - 24*a^6*c^3*d^4 + 29*a^6*c^4*d^3 + a^6*c^5*d^2))/(2*c*d^5 + d^6 + c^2*d^4) - (a^3*((64*(3*a^3
*d^11 - 3*a^3*c*d^10 - 4*a^3*c^2*d^9 + 4*a^3*c^3*d^8 + a^3*c^4*d^7 - a^3*c^5*d^6))/(2*c*d^7 + d^8 + c^2*d^6) +
 (64*a^3*tan(e/2 + (f*x)/2)*((c + d)^3*(c - d)^3)^(1/2)*(2*c + 3*d)*(c*d^10 - 2*c^3*d^8 + c^5*d^6))/((2*c*d^5
+ d^6 + c^2*d^4)*(3*c*d^5 + d^6 + 3*c^2*d^4 + c^3*d^3)))*((c + d)^3*(c - d)^3)^(1/2)*(2*c + 3*d))/(3*c*d^5 + d
^6 + 3*c^2*d^4 + c^3*d^3))*((c + d)^3*(c - d)^3)^(1/2)*(2*c + 3*d))/(3*c*d^5 + d^6 + 3*c^2*d^4 + c^3*d^3)))*((
c + d)^3*(c - d)^3)^(1/2)*(2*c + 3*d)*2i)/(f*(3*c*d^5 + d^6 + 3*c^2*d^4 + c^3*d^3))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ a^{3} \left (\int \frac {\sec {\left (e + f x \right )}}{c^{2} + 2 c d \sec {\left (e + f x \right )} + d^{2} \sec ^{2}{\left (e + f x \right )}}\, dx + \int \frac {3 \sec ^{2}{\left (e + f x \right )}}{c^{2} + 2 c d \sec {\left (e + f x \right )} + d^{2} \sec ^{2}{\left (e + f x \right )}}\, dx + \int \frac {3 \sec ^{3}{\left (e + f x \right )}}{c^{2} + 2 c d \sec {\left (e + f x \right )} + d^{2} \sec ^{2}{\left (e + f x \right )}}\, dx + \int \frac {\sec ^{4}{\left (e + f x \right )}}{c^{2} + 2 c d \sec {\left (e + f x \right )} + d^{2} \sec ^{2}{\left (e + f x \right )}}\, dx\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(f*x+e)*(a+a*sec(f*x+e))**3/(c+d*sec(f*x+e))**2,x)

[Out]

a**3*(Integral(sec(e + f*x)/(c**2 + 2*c*d*sec(e + f*x) + d**2*sec(e + f*x)**2), x) + Integral(3*sec(e + f*x)**
2/(c**2 + 2*c*d*sec(e + f*x) + d**2*sec(e + f*x)**2), x) + Integral(3*sec(e + f*x)**3/(c**2 + 2*c*d*sec(e + f*
x) + d**2*sec(e + f*x)**2), x) + Integral(sec(e + f*x)**4/(c**2 + 2*c*d*sec(e + f*x) + d**2*sec(e + f*x)**2),
x))

________________________________________________________________________________________